package com.zhongen.oa.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.base.MPJBaseMapper;
import com.zhongen.common.security.service.PigUser;
import com.zhongen.oa.entity.NotifyAnnouncementEntity;
import com.zhongen.oa.entity.dto.NotifyAnnouncementDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface NotifyAnnouncementMapper extends MPJBaseMapper<NotifyAnnouncementEntity> {

	IPage<NotifyAnnouncementDto> queryNotifyAnnouncementList(Page page,
			@Param("entity") NotifyAnnouncementDto notifyAnnouncement);

	IPage<NotifyAnnouncementDto> queryNotifyAnnouncementByUser(Page page,
			@Param("entity") NotifyAnnouncementDto notifyAnnouncement, @Param("loginUser") PigUser loginUser,
			@Param("roles") List<Long> roles);

	void deleteByAnnouncementId(@Param("announcementId") Long id);

	void insertAnnouncementDynamic(@Param("announcementId") Long id, @Param("recipientFilterType") String type,
			@Param("recipientList") List<String> recipientCondition);

}
